package com.chance.cc.crawler.prod.command.trigger.domain.news.pptv;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.news.pptv.searchKw.PPTVSimpleCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.pptv.searchKw.PPTVTraceTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @author lt
 * @version 1.0
 * @date 2020-12-09 16:15:28
 * @email okprog@sina.com
 */
public class PPTVCommonCrawlerScheduleTrigger extends CommonCrawlerSchedulerTrigger {
    public static void main(String[] args) {
//        publishPPTVSearchKwTraceTraceCrawlerScheduleTriggerInfo();
        publishPPTVSearchKwSimpleCrawlerScheduleTriggerInfo();
    }

    public static void publishPPTVSearchKwTraceTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = PPTVTraceTraceCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                PPTVTraceTraceCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 3 * * ?",
                "PPTV回溯采集任务执行，每天3点开始执行"
        );
    }

    public static void publishPPTVSearchKwSimpleCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = PPTVSimpleCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                PPTVSimpleCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "",
                "PPTV关键词临时采集"
        );
    }
}
